package com.manong.service.impl;

import com.manong.domain.Menu;
import com.manong.domain.MenuRole;
import com.manong.mapper.MenuMapper;
import com.manong.mapper.MenuRoleMapper;
import com.manong.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

// MenuServiceImpl.java 实现类
@Service
public class MenuServiceImpl implements MenuService {

    @Autowired
    private MenuMapper menuMapper;

    @Autowired
    private MenuRoleMapper menuRoleMapper;

    @Override
    public List<Menu> getMenus() {
        return menuMapper.selectAll();
    }

    @Override
    public List<MenuRole> getMenusByRole(Long roleId) {
        return menuRoleMapper.selectByMenuId(roleId);
    }
}